package com.isunland.managesystem.ui;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BaseFragment;
import com.isunland.managesystem.entity.BaseParams;
import com.isunland.managesystem.entity.rOutappMain;

/**
 * 对象功能:
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: HuXiaoDan
 * 创建时间: 2017/6/28 16:20
 */
public class RetailOutDetailActivity extends TableHeaderPagerActivity
    implements RetailOutMainDetailFragment.CallBack {
  private int[] titles = { R.string.order_detail, R.string.materiel_detail_list };

  @Override protected void onCreate(Bundle arg0) {
    mBaseParams = (BaseParams) getIntent().getSerializableExtra(BaseFragment.EXTRA_PARAMS);
    super.onCreate(arg0);
  }

  @Override protected Fragment createFragmentOne() {
    mBaseParams = (BaseParams) getIntent().getSerializableExtra(BaseFragment.EXTRA_PARAMS);
    return RetailOutMainDetailFragment.newInstance(mBaseParams, new RetailOutMainDetailFragment());
  }

  @Override protected Fragment createFragmentTwo() {
    mBaseParams = (BaseParams) getIntent().getSerializableExtra(BaseFragment.EXTRA_PARAMS);
    return RetailOutMaterielListFragment.newInstance(mBaseParams,
        new RetailOutMaterielListFragment());
  }

  @Override protected int[] createTitle() {

    return titles;
  }

  @Override public int getHeaderPosition() {
    return 1;
  }

  @Override public void onRefresh(rOutappMain content, int type) {
    setNavigateTo(1);
    //更新content
    RetailOutMaterielListFragment.getContent(content, type);
  }
}
